
<%
	task.doTask();
%>
<link href="style.css" rel="stylesheet" type="text/css">

<style type="text/css">
<!--
.style3 {font-weight: bold}
-->
</style>

<script language="javascript">

function cardViewClicked(wr_id)
{
	setValue("view",1);
	if (wr_id != null) setValue("wr_id",wr_id);
	doPost();
}

</script>
<form method="POST" name="formMain" action="" onSubmit="">				  
	<table width="100%"  border="0" class="style2">
          <tr bgcolor="#EEEEEE" class="style1" align="center">
            <td width="17%"><label id="e11">Order Ref</label></td>
            <td width="18%"><label id="e12">Client</label></td>
            <td width="21%"><label id="e13">Quality</label></td>
            <td width="20%"><label id="e14">Grade</label></td>
            <td width="24%"><label id="e15">Date</label></td>
      </tr>
          <tr>
             <td valign="top"><select name="order_id" id="order_id" onChange="setSelected('inst_id','0');setSelected('wn_id','0');doPost()" size=7 style="font-family:Arial; font-size:11px; width:100%;">
               <option value="0" selected>All</option>
               <%task.getResponse().setOption(task.getOrderList());%>
               <%task.getResponse().setSelected("order_id",task.order_id);%>
             </select> 
			</td>		  
             <td valign="top">
			   <select name="client_id" id="client_id" onChange="setSelected('order_id','0');setSelected('inst_id','0');setSelected('wn_id','0');doPost()" size=7 style="font-family:Arial; font-size:11px; width:100%;">
                 <option value="0" selected>All</option>
                 <%task.getResponse().setOption(task.getCompanyList("client"));%>
                 <%task.getResponse().setSelected("client_id",task.client_id);%>
               </select></td>
             <td valign="top"><select name="quality_id" id="quality_id" onChange="setSelected('order_id','0');setSelected('inst_id','0');setSelected('wn_id','0');doPost()" size=7 style="font-family:Arial; font-size:11px; width:100%;">
               <option value="0" selected>All</option>
               <%task.getResponse().setOption(task.getMasterList("quality_master"));%>
               <%task.getResponse().setSelected("quality_id",task.quality_id);%>
             </select>
			   			 
             </td>
             <td valign="top"><select name="grade_id" id="grade_id" onChange="setSelected('order_id','0');setSelected('inst_id','0');setSelected('wn_id','0');doPost()" size=7 style="font-family:Arial; font-size:11px; width:100%;">
               <option value="0" selected>All</option>
               <%task.getResponse().setOption(task.getMasterList("grade_master"));%>
               <%task.getResponse().setSelected("grade_id",task.grade_id);%>
             </select></td>
             <td valign="top">
               <select name="date_from" id="date_from" onChange="doPost()" size=7 style="font-family:Arial; font-size:11px; width: 100%;">
                 <option value="<%=Utils.nullDate%>" selected>All</option>
                 <%task.getResponse().setOption(task.getWR_DateList());%>
                 <%task.getResponse().setSelected("date_from","" + task.date_from);%>
               </select>
</td>
          </tr>
		  <tr id="wn_list_view">
			  <td colspan="5"  valign="top">
<div style="overflow:scroll; height:250px;">		  
			  <table width="100%"  border="0" class="style2">
                <tr align="center" bgcolor="#EEEEEE" class="style1">
                  <td width="36"><img src="images/refresh.gif" width="18" height="18" class="style3"></td>
                  <td width="140"><label id="e21">WR Ref</label></td>
                  <td width="138"><label id="e22">QR Ref</label></td>
                  <td width="114"><label id="e23">Date-Time</label></td>
                  <td width="109"><label id="e24">Client</label></td>
                  <td width="100"><label id="e25">Quality</label></td>
                  <td width="194"><label id="e26">Grade</label></td>
                </tr>
<%
	ResultSet rs = task.getWR_WC_Detail();
	while (rs.next()) {
%>				
                <tr style="font-size:11px" onClick="highlightOn(this)" onDblClick="cardViewClicked(<%=rs.getInt("id")%>)">
                  <td align="right"><%=rs.getRow()%></td>
                  <td><%=rs.getString("ref_number")%></td>
                  <td><%=rs.getString("qr_ref_number")%></td>
                  <td><%=Utils.dateToStr(rs.getDate("wr_date"))%>&nbsp;<%=Utils.timeToStr(rs.getTime("wr_time"))%></td>
                  <td><%=rs.getString("client")%></td>
                  <td><%=rs.getString("quality")%></td>
                  <td><%=rs.getString("grade")%></td>
                </tr>
<%
	}
	rs.close();
%>				
                <tr>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
          </table>
</div>		  
			  </td>
		  </tr>

		  <tr id="wn_card_view" style="display:">
             <td colspan="5" align="right"><img src="images/report.jpg" width="55" height="18"><img id="bt_card_view" src="images/cardview.jpg" width="55" height="18" onClick="cardViewClicked();"></td>
		  </tr>
  </table>
	<input type="hidden" name="uid"  id="uid"  value="<%=user.getuid()%>">
	<input type="hidden" name="task_id"  id="task_id"  value="0">
	<input type="hidden" name="view" id="view" value="<%=task.getRequest().getIntValue("view")%>">	
	<input type="hidden" name="wr_id"  id="wr_id"  value="0">
</form>

<label id="v11" style="display:none">L&#7879;nh th&#7921;c hi&#7879;n</label>
<label id="v12" style="display:none">Ch&#7911; h&agrave;ng</label>
<label id="v13" style="display:none">Ch&#7845;t l&#432;&#7907;ng</label>
<label id="v14" style="display:none">Lo&#7841;i h&agrave;ng</label>
<label id="v15" style="display:none">Ng&agrave;y</label>

<label id="v21" style="display:none">Ch&#7913;ng t&#7915;</label>
<label id="v22" style="display:none">Tham chi&#7871;u<br>Ch&#7845;t l&#432;&#7907;ng</label>
<label id="v23" style="display:none">Ng&agrave;y,gi&#7901;</label>
<label id="v24" style="display:none"></label>
<label id="v25" style="display:none">Ch&#7845;t l&#432;&#7907;ng</label>
<label id="v26" style="display:none">Lo&#7841;i h&agrave;ng</label>

